<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = new Date();
        var year = arr.getFullYear();
        var month = arr.getMonth() + 1;
        var date = arr.getDate();
        month < 10? month = '0' + month : month;
        date < 10? date = '0' + date : date;
        var ruselt = year + '-' + month + '-' + date;

        console.log(ruselt);
    </script>
</body>
</html>